//
//  Person.m
//  EncryptionTPB
//
//  Created by LvJianfeng on 15/9/15.
//  Copyright © 2015年 coderjianfeng. All rights reserved.
//

#import "Person.h"
#import "TPBInitialize.h"
#import "FMDatabase.h"

@implementation Person
+ (BOOL)insert:(Person*)p{
    if (!p) {
        return NO;
    }
    BOOL isOK = NO;
    FMDatabase *db = [FMDatabase databaseWithPath:[TPBInitialize databaseFilePath]];
    if (db) {
        [db open];
        isOK = [db executeUpdate:@"insert into STPB_AddressBook(uid, name, phone, telephone, organization, department, jobTitle, email, avatarUrl, note, country, city, state, street, zip, countryCode) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", p.uid, p.name,p.phone,p.telephone,p.organization,p.department,p.jobTitle,p.email,p.avatarUrl,p.note,p.country,p.city,p.state,p.street,p.zip,p.countryCode];
        [db close];
    }
    return isOK;
}
@end
